//
//  ViewController.m
//  24-加密
//
//  Created by dllo on 16/8/16.
//  Copyright © 2016年 ZHW. All rights reserved.
//

#import "ViewController.h"
#import "NSString+ZHWMD5.h"
#import "NSString+ZHWSHA_1.h"
#import "NSString+ZHWBase64.h"
#import "NSString+ZHWDES.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    /*
    // Do any additional setup after loading the view, typically from a nib.
    // 1 MD5 验证算法 一般应用验证密码
    NSString *str = @"796321";
    NSString *final32BitLowerStr = [str stringWith32BitMD5Lower];
    NSLog(@"32位小写:%@", final32BitLowerStr);
    NSString *final32BitUpperStr = [str stringWith32BitMD5Upper];
    NSLog(@"%@", final32BitUpperStr);
    NSString *final16BitLowerStr = [str stringWith16BitMD5Lower];
    NSLog(@"16位小写:%@", final16BitLowerStr);
    // 2
    NSString *finalSHA_1Str = [str stringWithSHA_1];
    NSLog(@"finalSHA1Str = %@", finalSHA_1Str);
    
    // 3 Base64
    NSString *baseStr = @"hiaaa";
    NSString *afterBaseStr = [baseStr stringWithBase64];
    NSLog(@"Base64编码后为. : %@", afterBaseStr);
    NSString *jieStr = [afterBaseStr base64WithString];
    NSLog(@"解码为%@", jieStr);
    */
    
    // 4 对称密码
    // 三种算法 DES 3重DES AES
    NSString *string = @"123";
    NSString *desString = [string stringWithDES];
    NSLog(@"%@", desString);
    NSString *jieString = [desString desWithString];
    NSLog(@"%@", jieString);
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
